package j07zhoukao;

import java.util.Arrays;

public class J2duijiao {
    public static void main(String[] args) {
        int[][] arr = new int[6][6];
        int sum = 0;
        int num = 1;
        for (int i = 0; i < 6; i++) {
            for (int j = 0; j < 6; j++) {
                //进入36次
                arr[i][j] = num;
                if(i==j || i+j==5){
                    sum += num;
                }
                num++;
            }
        }
        System.out.println(Arrays.deepToString(arr));
        System.out.println("sum = " + sum);
    }
}
